package com.bw.liuyushan.zhuangao4_mvptest1.MVP.View.Activity;

import android.content.Intent;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.bw.liuyushan.mvp_lib.View.BaseActivity;
import com.bw.liuyushan.zhuangao4_mvptest1.MVP.Contrack.ICTest;
import com.bw.liuyushan.zhuangao4_mvptest1.MVP.Model.BaseModelTest;
import com.bw.liuyushan.zhuangao4_mvptest1.MVP.Presenter.BasePresenterTest;
import com.bw.liuyushan.zhuangao4_mvptest1.R;

/**
 * ZhuanGao4_MVPTest1
 * file name is : BanItemActivity
 * created by Ender on 2021/8/18 14:28.
 * author : Liuyushan
 * Describe(作用):轮播图点击跳转的Activity
 */
public class BanItemActivity extends BaseActivity<BasePresenterTest> implements ICTest.C_ViewTest{
    private android.widget.TextView tvBannerrv;
    private android.widget.ImageView imgbannerrv;

    @Override
    public int bindLayout() {
        return R.layout.activity_banrvitem;
    }

    @Override
    public void initView() {
        //防止内存泄露
        ip = new BasePresenterTest(new BaseModelTest(), this);

        tvBannerrv = (TextView) findViewById(R.id.tv_bannerrv);
        imgbannerrv = (ImageView) findViewById(R.id.imgbannerrv);
    }

    @Override
    public void initDate() {
        Intent intent = getIntent();
        String title = intent.getStringExtra("title");
        String image = intent.getStringExtra("image");
        tvBannerrv.setText(title);
        Glide.with(getApplicationContext()).load(image).into(imgbannerrv);

    }
}
